<!DOCTYPE html>
<html style="background-color:#ffffff">
  <head>
    <meta charset="utf-8">
    <title>获取更多声望</title>
  </head>
      <link rel="stylesheet" type="text/css" href="../../css/api.css"/>
      <link rel="stylesheet" type="text/css" href="../../css/yzl.css"/>
  <body style="background-color:#ffffff">
    <div id="blank" class="header" v-cloak >
        <div v-back.tapmode class="back"></div>
        <span class="title">获取更多声望</span>
    </div>
    <div id="app">
      <div class="coin_proper" style="background-color: #EDE4FF;margin-top:70px;">
        <div class="coin-count" style="font-size: 14px;text-align:left">你可以前往交易市场购买营养奶以获得声望。每桶营养奶可以获得50声望。</div>
        <div class="button" v-row-active.tapmode @click="opendshop">购买营养奶</div>
      </div>
      <div class="coin_proper" style="background-color: #E3EDFF;margin-top:10px;">
        <div class="coin-count" style="font-size: 14px;text-align:left">你直接分享的用户购买营养奶，你会获得声望。假设直接分享的用户购买1桶营养奶，他会获得50声望，你会获得20声望。</div>
        <div class="button" v-myclick="['session',share_wx]" v-row-active.tapmode>立即分享</div>
      </div>
      <div class="coin_proper" style="background-color: #E3FFEF;margin-top:10px;">
        <div class="coin-count" style="font-size: 14px;text-align:left">你的团队成员购买营养奶，你也会获得声望。团队内任意成员购买1桶营养奶，你都能从中获得4声望。</div>
        <div class="button" v-myclick="['session',share_wx]" v-row-active.tapmode>立即分享</div>
      </div>
    </div>
  </body>
  <script src="../../script/api.js"></script>
  <script src="../../script/vue.js"></script>
  <script src="../../script/app.js"></script>
  <script src="../../script/common.js"></script>
  <script src="../../script/url.js"></script>
  <script src="../../script/swiper.js"></script>
  <script type="text/javascript">
  var user;
  var vm;
  var wx;
  var user;
  var qrcode;




  apiready = function () {
      var data = {
          member_id: getPrefs('member_id')
      };
      var callback = function (ret) {
          user = ret.content;
          initApp();
      };
      pinet.post(URL.getUserinfo, data, callback);
      setBSImg();
      wx = api.require('wx');
      new Vue({
          el: '#blank'
      });

      addListeners();
  };

  function initApp() {
      vm = new Vue({
          el: '#app',
          data: {
            user: user,
            appInstalled: {
                wx: true
            },
          },
          computed:{
          },
          created: function () {
              var that = this;
              wx.isInstalled(function (ret) {
                  that.appInstalled.wx = ret.installed;
              });
          },
          methods:{
            opendshop:function(){
              var url = yimahost+"buy.html?member_id="+getPrefs('member_id')+"&token="+getPrefs('token');
              openWin("../game/yima",{url: url});
            },
            share_wx: function (scene) {
               var that = this;
                if(!that.appInstalled.wx){
                  api.alert({
                      title: '提示',
                      msg: '未能检测到本地微信',
                      buttons: ['确定']
                  }, function (ret, err) {});
                }else{
                  console.log(1111)
                  share_wx(scene, vm.user.share);
                }
            }
          }
      });
  }

  </script>
</html>
